import { View } from "@tarojs/components";
import { useState, useEffect } from "react";
import Taro from "@tarojs/taro";
import { AtButton } from "taro-ui";

import "./index.scss";

const Index = () => {
  const handleClick = () => {
    console.log(123);
    Taro.navigateTo({
      url: "../cosmeticgag/index"
    });
  };

  const handleCamera = () => {
    Taro.scanCode({
      success: res => {
        console.log(res);
      }
    });
  };

  return (
    <View className="container safe-area">
      <AtButton type="primary" onClick={handleClick} circle={true}>
        查找顾客货品
      </AtButton>
      <AtButton type="secondary" onClick={handleCamera} circle={true}>
        扫一扫
      </AtButton>
    </View>
  );
};

export default Index;
